<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全球最大的嵌入式学习网站</title>
    <style>
        :root {
            --primary: #00f7ff;
            --secondary: #0066ff;
            --dark: #0a0e17;
            --light: #e0f7fa;
            --glow: 0 0 10px rgba(0, 247, 255, 0.7);
        }

        body {
            font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
            line-height: 1.6;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            color: var(--light);
            background-color: var(--dark);
            background-image:
                radial-gradient(circle at 10% 20%, rgba(0, 103, 255, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(0, 247, 255, 0.1) 0%, transparent 20%);
        }

        header {
            text-align: center;
            padding: 40px 0;
            margin-bottom: 50px;
            position: relative;
            overflow: hidden;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(10, 14, 23, 0.8) 0%, rgba(0, 22, 50, 0.9) 100%);
            box-shadow: var(--glow);
        }

        header::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background:
                linear-gradient(45deg, transparent 65%, var(--primary) 75%, transparent 85%),
                linear-gradient(-45deg, transparent 65%, var(--primary) 75%, transparent 85%);
            background-size: 40px 40px;
            opacity: 0.1;
            animation: gridMove 20s linear infinite;
        }

        @keyframes gridMove {
            0% {
                transform: translate(0, 0);
            }

            100% {
                transform: translate(40px, 40px);
            }
        }

        h1 {
            margin: 0;
            font-size: 3em;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            position: relative;
            text-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
        }

        h2 {
            font-size: 2em;
            margin: 60px 0 20px;
            color: var(--primary);
            position: relative;
            padding-left: 20px;
        }

        h2::before {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            height: 70%;
            width: 5px;
            background: linear-gradient(to bottom, var(--primary), var(--secondary));
            border-radius: 3px;
        }

        .subtitle {
            font-size: 1.2em;
            margin-top: 15px;
            color: rgba(224, 247, 250, 0.8);
        }

        .courses-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 30px;
            margin: 30px 0;
        }

        .course-card {
            background: linear-gradient(145deg, rgba(16, 22, 36, 0.8) 0%, rgba(0, 40, 80, 0.6) 100%);
            border-radius: 16px;
            padding: 30px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(0, 247, 255, 0.1);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            text-decoration: none;
            color: inherit;
            display: block;
        }

        .course-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
        }

        .course-card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: 0 12px 40px rgba(0, 103, 255, 0.4);
            border-color: rgba(0, 247, 255, 0.3);
        }

        .course-card:hover::after {
            opacity: 1;
        }

        .course-card::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at center, rgba(0, 247, 255, 0.05) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .course-title {
            font-size: 1.5em;
            margin-bottom: 15px;
            color: var(--primary);
            font-weight: bold;
        }

        .course-link {
            display: inline-block;
            margin-top: 20px;
            padding: 10px 20px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            color: var(--dark);
            text-decoration: none;
            border-radius: 30px;
            font-weight: bold;
            transition: all 0.3s ease;
            box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
            position: relative;
            overflow: hidden;
            cursor: pointer;
            border: none;
        }

        .course-link::before {
            content: "";
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: all 0.5s ease;
        }

        .course-link:hover {
            transform: scale(1.05);
            box-shadow: 0 0 25px rgba(0, 247, 255, 0.5);
        }

        .course-link:hover::before {
            left: 100%;
        }

        .qr-codes {
            display: flex;
            justify-content: space-around;
            margin-top: 80px;
            padding: 40px;
            background: linear-gradient(145deg, rgba(16, 22, 36, 0.8) 0%, rgba(0, 40, 80, 0.6) 100%);
            border-radius: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(0, 247, 255, 0.1);
        }

        .qr-code {
            text-align: center;
            padding: 20px;
            background: rgba(10, 14, 23, 0.5);
            border-radius: 12px;
            transition: all 0.3s ease;
        }

        .qr-code:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 20px rgba(0, 247, 255, 0.3);
        }

        .qr-code img {
            width: 180px;
            height: 180px;
            border: 2px solid rgba(0, 247, 255, 0.3);
            border-radius: 8px;
            padding: 10px;
            background: white;
        }

        .qr-code p {
            margin-top: 15px;
            font-weight: bold;
            color: var(--primary);
            font-size: 1.1em;
        }

        footer {
            text-align: center;
            margin-top: 50px;
            padding: 30px;
            color: rgba(224, 247, 250, 0.6);
            font-size: 0.9em;
        }

        .tech-circle {
            position: absolute;
            border-radius: 50%;
            border: 1px solid rgba(0, 247, 255, 0.2);
            pointer-events: none;
        }

        .tech-circle:nth-child(1) {
            width: 100px;
            height: 100px;
            top: 20%;
            left: 5%;
            animation: float 8s ease-in-out infinite;
        }

        .tech-circle:nth-child(2) {
            width: 60px;
            height: 60px;
            bottom: 10%;
            right: 8%;
            animation: float 6s ease-in-out infinite reverse;
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-20px);
            }
        }
    </style>
</head>

<body>
    <div class="tech-circle"></div>
    <div class="tech-circle"></div>

    <!-- 显示用户名 判断是否登录-->
    {if $user}
    <div style="position: absolute; top: 20px; right: 20px; text-align: right;">
        <p style="color: #fff; font-style: italic; margin-top: 5px; margin-bottom: 0;">欢迎您，<span
                id="username">{$user.username}</span>
        </p>
        <!-- 会员到期时间 -->
        <p style="color: #fff; font-style: italic; margin-top: 5px; margin-bottom: 0;">
            您的会员到期时间：{$user.expiration_date}<span id="expireDate"></span></p>
        <!-- 退出 -->
        <a   onclick="logout()" style="color: #fff; font-style: italic; margin-top: 5px; margin-bottom: 0;cursor: pointer;">退出登录</a>
    </div>
    {/if}

    <header>
        <h1>嵌入式学习大本营</h1>
        <p class="subtitle">探索编程宇宙 · 掌握未来科技</p>
        <p style="color: red; font-style: italic; margin-top: 5px;">只要39元全站内容任意看</p>

    </header>

    <!-- 编程语言部分 -->
    <h2>编程语言</h2>
    <div class="courses-container">
        <a href="/doc1/c_language/index.html" class="course-card">
            <h3 class="course-title">C语言编程基础入门</h3>
            <p>掌握嵌入式开发的基石，开启底层编程之旅</p>
            <span
                style="background: #FFEB3B; color: #000; padding: 3px 8px; border-radius: 10px; font-weight: bold;">测试一下...</span><br>
            <button class="course-link" onclick="window.location.href='/doc1/c_language/index.html'">进入专栏</button>
            <button class="course-link" onclick="window.location.href='/doc1/c_language/index.html'">进入课程</button>
            <span
                style="background: #FF0000; color: #FFF; padding: 4px 10px; border-radius: 4px; font-weight: bold; font-size: 16px;">限时0元</span>
        </a>

        <a href="/doc1/c++/index.html" class="course-card">
            <h3 class="course-title">C++编程基础入门</h3>
            <p>面向对象编程的利器，现代嵌入式开发必备</p>
            <button class="course-link" onclick="window.location.href='/doc1/c++/index.html'">进入课程</button>
        </a>

        <a href="/doc1/python01/index.html" class="course-card">
            <h3 class="course-title">Python基础入门</h3>
            <p>人工智能时代的瑞士军刀，高效开发的首选</p>
            <button class="course-link" onclick="window.location.href='/doc1/python01/index.html'">进入课程</button>
        </a>

        <a href="/doc1/rust01/index.html" class="course-card">
            <h3 class="course-title">Rust编程入门</h3>
            <p>未来系统级开发语言，安全与性能的完美结合</p>
            <button class="course-link" onclick="window.location.href='/doc1/rust01/index.html'">进入课程</button>
        </a>

        <a href="/doc1/cpp_cases/index.html" class="course-card">
            <h3 class="course-title">C++语言实战50例</h3>
            <p>50个C++经典示例，带你快速掌握C++核心原理</p>
            <button class="course-link" onclick="window.location.href='/doc1/cpp_cases/index.html'">进入课程</button>
        </a>
        <a href="/doc1/cpp_qt_cases/index.html" class="course-card">
            <h3 class="course-title">C++和QT基础入门</h3>
            <p>C++和QT的完美结合，学习致用，进入UI显示的大门</p>
            <button class="course-link" onclick="window.location.href='/doc1/cpp_qt_cases/index.html'">进入课程</button>
        </a>
        <a href="/doc1/c_example_50/index.html" class="course-card">
            <h3 class="course-title">C语言实战50例</h3>
            <p>50个C语言经典示例，职场面试必杀技！</p>
            <button class="course-link" onclick="window.location.href='/doc1/c_example_50/index.html'">进入课程</button>
        </a>
        <a href="/doc1/makefile_cases/index.html" class="course-card">
            <h3 class="course-title">Makefile完全指南</h3>
            <p>学习makefile看这一份就够了</p>
            <button class="course-link" onclick="window.location.href='/doc1/makefile_cases/index.html'">进入课程</button>
        </a>
        <a href="/doc1/python_cases/index.html" class="course-card">
            <h3 class="course-title">Python从入门到精通</h3>
            <p>人人都要学习的Python，深度讲解</p>
            <button class="course-link" onclick="window.location.href='/doc1/python_cases/index.html'">进入课程</button>
        </a>

    </div>

    <!-- 版本工具部分 -->
    <h2>版本工具</h2>
    <div class="courses-container">
        <a href="/doc1/git01/index.html" class="course-card">
            <h3 class="course-title">Git基础入门</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/git01/index.html'">进入课程</button>
        </a>

        <a href="/doc1/svn01/index.html" class="course-card">
            <h3 class="course-title">SVN基础入门</h3>
            <p>企业级版本控制系统，传统项目管理利器</p>
            <button class="course-link" onclick="window.location.href='/doc1/svn01/index.html'">进入课程</button>
        </a>
    </div>

    <!-- ARM架构部分 -->
    <h2>ARM架构</h2>
    <div class="courses-container">
        <a href="/doc1/armv8_doc/index.html" class="course-card">
            <h3 class="course-title">Cortex-A中文入门指南</h3>
            <p>快速扫盲Armv8/Armv9技术，翻译</p>
            <button class="course-link" onclick="window.location.href='/doc1/armv8_doc/index.html'">进入课程</button>
        </a>

        <a href="/doc1/cortex_r/index.html" class="course-card">
            <h3 class="course-title">Cortex-R中文入门指南</h3>
            <p>快速扫盲Cortex-R架构技术，翻译</p>
            <button class="course-link" onclick="window.location.href='/doc1/cortex_r/index.html'">进入课程</button>
        </a>

        <a href="/doc1/jobs/index.html" class="course-card">
            <h3 class="course-title">找工作:ARM架构和安全</h3>
            <p>ARM架构和TEE安全职位的介绍</p>
            <button class="course-link" onclick="window.location.href='/doc1/jobs/index.html'">进入课程</button>
        </a>

        <a href="/doc1/exception/index.html" class="course-card">
            <h3 class="course-title">GIC&异常中断-百问百答</h3>
            <p>GIC&异常中断-百问百答</p>
            <button class="course-link" onclick="window.location.href='/doc1/exception/index.html'">进入课程</button>
        </a>

        <a href="/doc1/arm64_chapters/index.html" class="course-card">
            <h3 class="course-title">ARM64汇编基础入门</h3>
            <p>Armv8/Armv9的aarch64架构汇编</p>
            <button class="course-link" onclick="window.location.href='/doc1/arm64_chapters/index.html'">进入课程</button>
        </a>

        <a href="/doc1/cortex_m_chapters/index.html" class="course-card">
            <h3 class="course-title">Cortex-M基础入门</h3>
            <p>Cortex-M是一切工业信息技术的基础</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/cortex_m_chapters/index.html'">进入课程</button>
        </a>


    </div>

    <!-- Linux相关部分 -->
    <h2>Linux相关</h2>
    <div class="courses-container">
        <a href="/doc1/linux01/index.html" class="course-card">
            <h3 class="course-title">Linux基础入门</h3>
            <p>开源世界的基石，嵌入式开发的黄金平台</p>
            <button class="course-link" onclick="window.location.href='/doc1/linux01/index.html'">进入课程</button>
        </a>

        <a href="/doc1/how-to-write-makefile/index.html" class="course-card">
            <h3 class="course-title">makefile入门指南</h3>
            <p>程序员必备的makefile编译技术</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/how-to-write-makefile/index.html'">进入课程</button>
        </a>

        <a href="/doc1/linux/index.html" class="course-card">
            <h3 class="course-title">Linux内核深度学习</h3>
            <p>掌握Linux内核硬科技</p>
            <span
                style="background: #FFEB3B; color: #000; padding: 3px 8px; border-radius: 10px; font-weight: bold;">本篇转自github</span><br>
            <button class="course-link" onclick="window.location.href='/doc1/linux/index.html'">进入课程</button>
        </a>

        <a href="/doc1/linux_kernel_chapters/index.html" class="course-card">
            <h3 class="course-title">Linux内核设计与实现</h3>
            <p>18个章节带您深度学习Linux内核知识</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/linux_kernel_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/device_tree_chapters/index.html" class="course-card">
            <h3 class="course-title">Linux设备树深度解析</h3>
            <p>掌握Linux必学的章节</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/device_tree_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/linux_process_chapters/index.html" class="course-card">
            <h3 class="course-title">Linux进程管理专题</h3>
            <p>掌握Linux内核硬科技</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/linux_process_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/linux_memory_chapters/index.html" class="course-card">
            <h3 class="course-title">Linux内存管理专题</h3>
            <p>掌握Linux内核硬科技</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/linux_memory_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/linux_io_chapters/index.html" class="course-card">
            <h3 class="course-title">Linux内核IO和文件系统专题</h3>
            <p>掌握Linux内核硬科技</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/linux_io_chapters/index.html'">进入课程</button>
        </a>

    </div>



    <!-- 单片机/RTOS -->
    <h2>单片机/RTOS</h2>
    <div class="courses-container">
        <a href="/doc1/mcu51_chapters/index.html" class="course-card">
            <h3 class="course-title">51单片机基础入门</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/mcu51_chapters/index.html'">进入课程</button>
        </a>

        <a href="/doc1/stm32_chapters/index.html" class="course-card">
            <h3 class="course-title">STM32单片机基础入门</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/stm32_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/esp32_chapters/index.html" class="course-card">
            <h3 class="course-title">ESP32单片机基础入门</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/esp32_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/freertos_chapters/index.html" class="course-card">
            <h3 class="course-title">FreeRTOS入门与实战</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/freertos_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/rt_thread_chapters/index.html" class="course-card">
            <h3 class="course-title">RT-Thread入门与实战</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link"
                onclick="window.location.href='/doc1/rt_thread_chapters/index.html'">进入课程</button>
        </a>
        <a href="/doc1/zephyr_chapters/index.html" class="course-card">
            <h3 class="course-title">Zephyr入门与实战</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/zephyr_chapters/index.html'">进入课程</button>
        </a>
    </div>

    <!-- 安全 -->
    <h2>安全</h2>
    <div class="courses-container">
        <a href="/doc1/optee_docs/index.html" class="course-card">
            <h3 class="course-title">optee官方文档(中文)</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/optee_docs/index.html'">进入课程</button>
        </a>

        <a href="/doc1/mbedtls_chapters/index.html" class="course-card">
            <h3 class="course-title">MbedTLS实战入门</h3>
            <p>企业级版本控制系统，传统项目管理利器</p>
            <button class="course-link" onclick="window.location.href='/doc1/mbedtls_chapters/index.html'">进入课程</button>
        </a>
    </div>

    <!-- 其它架构 -->
    <h2>其它架构</h2>
    <div class="courses-container">
        <a href="/doc1/x86_chapters/index.html" class="course-card">
            <h3 class="course-title">X86架构专题</h3>
            <p>版本控制专家，团队协作开发的核心工具</p>
            <button class="course-link" onclick="window.location.href='/doc1/x86_chapters/index.html'">进入课程</button>
        </a>

        <a href="/doc1/riscv_chapters/index.html" class="course-card">
            <h3 class="course-title">Risc-v架构专题</h3>
            <p>企业级版本控制系统，传统项目管理利器</p>
            <button class="course-link" onclick="window.location.href='/doc1/riscv_chapters/index.html'">进入课程</button>
        </a>
    </div>
</body>

</html>
<script>

    function logout() {
        fetch('/index/user/logout', {
            method: 'POST',
            credentials: 'include', // 保持现有
        }).then(response => { 
            if (response.ok) {
                window.location.href = '/index/user/login';
            }
        }).catch(error => {
            console.error('注销失败:', error);
        });
    }

    // 监听所有课程卡片的点击事件
    document.querySelectorAll('.course-card').forEach(card => {
        card.addEventListener('click', async function (e) {
            e.preventDefault(); // 阻止默认链接行为
            const course = this.getAttribute('href').replace('.html', ''); 
            const folderName = course.split('/')[2];

            try {
                const response = await fetch('/index/user/checkFolderAuth', {
                    method: 'POST',
                    credentials: 'include', // 保持现有
                    headers: {
                        'Content-Type': 'application/json',
                        'Accept': 'application/json' // 添加Accept头
                    },
                    body: JSON.stringify({ name: folderName }),
                    mode: 'cors' // 明确指定CORS模式
                });
                const data = await response.json();
                if (data.code == 403) {
                    window.location.href = '/index/user/login';
                } else if (data.code === 1) {
                    window.location.href = '/doc1/' + folderName + '/index.html?fname=' + folderName;
                } else {
                    window.location.href = '/index/user/goumai';
                }
            } catch (error) {
                console.log(error);
            }
        });
    });

</script>